using System.Text;

namespace DynamicConfigurationManager
{
    ///<summary>
    /// A simple log class to capture and hold log messages for later retrieval
    ///</summary>
    public static class LogHelper
    {
        private static readonly StringBuilder _log = new StringBuilder();

        ///<summary>
        /// Append a formatted message to the log
        ///</summary>
        public static void Append( string msgfmt, params object[] objs )
        {
            _log.AppendLine( string.Format( msgfmt, objs ) );
        }

        ///<summary>
        /// Return the resulting captured log messages
        ///</summary>
        public static string Entry => _log.Length == 0 ? "Nothing logged" : _log.ToString();
    }
}